home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 6 / Amiga Format AFCD06 (Nov 1996, Issue 90).iso / serious / commercial / xfa_devkit / blitz / xfa_pack.ascii < prev    next >
Text File  |  1995-05-15  |  2KB  |  112 lines

  1.  
  2. ;********************************************************************
  3. ;
  4. ; (c) Mik of ClassX 1995
  5. ;
  6. ;
  7. ; How to pack a sequence of frames
  8. ;
  9. ;********************************************************************
  10.  
  11.  
  12. XINCLUDE "LIB_XFA.BB"
  13.  
  14. WBStartup
  15. NoCli
  16. DEFTYPE.l
  17.  
  18.  
  19. ;open destination screen
  20. Screen 0,0,0,640,512,2,$8004,"",2,1
  21. ScreensBitMap 0,0
  22.  
  23. ;set a visible palette
  24. PalRGB 0,0,0,0,$f
  25. Use Palette 0
  26.  
  27. ;allocate some frames
  28. If XFA_AllocFrames_(500)
  29.  
  30.   ;set pack screen and packmode for library use  (change mode here)
  31.   XFA_SetPack_ Peek.l(Addr Screen(0)),#XFA_MODE32I
  32.  
  33.   ;open pack stuff
  34.   If XFA_OpenPackStuff_
  35.  
  36.     c=0
  37.     ;init pack sequence
  38.     If XFA_PosOnFrame_(c)
  39.       For i=0 To 359 Step 3
  40.         x = Sin(i*Pi/180)*200+320
  41.         y = Cos(i*Pi/180)*200+256
  42.  
  43.         ;silly draw
  44.         Circle x,y,50,1
  45.         Circle x,y,49,1
  46.         Circle x,y,48,2
  47.         Circle x,y,47,2
  48.  
  49.         ;attempt to pack the frame
  50.         If XFA_PutFrame_(c)=0
  51.           ;error handling
  52.         EndIf
  53.  
  54.         c+1
  55.  
  56.       Next i
  57.     EndIf
  58.  
  59.  
  60.  
  61.     c=0
  62.     ;init another pack sequence
  63.     If XFA_PosOnFrame_(c)
  64.       For i=0 To 359 Step 3
  65.         x = Sin(3*i*Pi/180)*200+320
  66.         y = Cos(5*i*Pi/180)*200+256
  67.  
  68.         ;silly draw
  69.         Circle x,y,50,1
  70.         Circle x,y,49,1
  71.         Circle x,y,48,2
  72.         Circle x,y,47,2
  73.  
  74.         ;attempt to pack the frame
  75.         If XFA_PutFrame_(c)=0
  76.           ;error handling
  77.         EndIf
  78.  
  79.         c+1
  80.  
  81.       Next i
  82.     EndIf
  83.  
  84.  
  85.     ;done: close pack stuff and put loop frames
  86.     XFA_ClosePackStuff_(#CLOSE_LOOP)
  87.  
  88.     ;now we can save the animation
  89.     If XFA_SaveAnim_("t:a.xfa")<>0
  90.       ;error handling
  91.     EndIf
  92.  
  93.  
  94.   EndIf
  95.  
  96.   ;free animation frames and array
  97.   XFA_FreeFrames_
  98.  
  99. EndIf
  100.  
  101.  
  102. End
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.